package com.qn.analyze.controlle;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaIgnore;
import com.qn.analyze.entity.UserAgentMetrics;
import com.qn.analyze.service.UserAgentMetricsService;
import com.qn.analyze.vo.UserAgentMetricsQueryVo;
import com.qn.common.base.BaseControlle;
import com.qn.common.base.model.ResponseRows;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@Tag(name = "系统-UserAgent指标统计")
@SaCheckLogin
@RestController
@RequestMapping("user-agent/metrics")
public class UserAgentMetricsController extends BaseControlle {
    @DubboReference(version = "1.0.0")
    private UserAgentMetricsService service;
    @Operation(summary ="设备类型-列表")
    @PostMapping("getContinentList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getDeviceClassList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getDeviceClassList(where));
    }
    @Operation(summary ="设备制造商-列表")
    @PostMapping("getDeviceBrandList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getDeviceBrandList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getDeviceBrandList(where));
    }
    @Operation(summary ="操作系统-列表")
    @PostMapping("getSystemNameList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getSystemNameList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getSystemNameList(where));
    }
    @Operation(summary ="浏览器类型-列表")
    @PostMapping("getBrowserTypeList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getBrowserTypeList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getBrowserTypeList(where));
    }
    @Operation(summary ="浏览器名称-列表")
    @PostMapping("getBrowserNameList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getBrowserNameList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getBrowserNameList(where));
    }

    @Operation(summary ="操作系统名称统计-列表")
    @PostMapping("getSystemNameStatisticsList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getSystemNameStatisticsList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getSystemNameStatisticsList(where));
    }
    @Operation(summary ="浏览器名称统计-列表")
    @PostMapping("getBrowserNameStatisticsList")
    @SaIgnore
    public ResponseRows<UserAgentMetrics> getBrowserNameStatisticsList(@RequestBody UserAgentMetricsQueryVo where){
        return successR(service.getBrowserNameStatisticsList(where));
    }
}